Loop through all records

You can loop through records of a different object type within a template, not just through related records. You must explicitly specify the object name as prefix to template tokens. For example, use {!order.name}, not the unqualified {!name} You can limit the number of records to display by adding the (numRecords) token at the end of #LOOP_BEGIN. If not specified, the number of records is limited to 100. Merge field helpers do not provide support for looping through all records.

To accomplish this, follow these steps:

  1. Create a list view that sorts and filters records the way you desire. For example, you might sort by the most recent records updated at value.
  2. Click the view name in the object definition and note the value of that view's Original ID.
  3. Use the Original ID in the template:
    {!#LOOP_BEGIN.all#originalViewId} … {!#LOOP_END.all}
    Use the object's integration name as prefix for merge fields used inside loops through all records. Example:
    {!#LOOP_BEGIN.all#479484}
       {!order.name}
       {!#LOOP_END.all}
    Instead of {!name}, the {!order.name} token causes Platform to replace the merge field with the related record's name rather than that of the parent object record.